package v1

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

type ExcelData struct {
	Headers []string                 `form:"headers" json:"headers"`
	Data    []map[string]interface{} `form:"data" json:"data"`
}

func UploadExcel(c *gin.Context) {
	var excel_data ExcelData
	err := c.ShouldBindJSON(&excel_data)
	if err != nil {
		c.JSON(201, gin.H{"msg": "接收数据有误", "data": nil})
		return
	}
	fmt.Println(excel_data)
	c.JSON(http.StatusOK, gin.H{"msg": "成功", "data": nil})
	return
}
